package com.atguigu.gmall.cart.client;

import com.atguigu.gmall.cart.client.impl.CartDegradeFeignClient;
import com.atguigu.gmall.order.model.OrderDetail;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(value = "service-cart", path = "/api/cart", fallback = CartDegradeFeignClient.class)
public interface CartFeignClient {


    /**
     * 根据用户ID，查询用户购物车商品，将CartInfo转为OrderDetail对象
     *
     * @param userId
     * @return
     */
    @ApiOperation("根据用户ID，查询用户购物车商品，将CartInfo转为OrderDetail对象")
    @GetMapping("/getCartCheckedList/{userId}")
    public List<OrderDetail> getCartCheckedList(@PathVariable("userId") Long userId);
}
